package com.lyq.bean;

import java.io.Serializable;

public class EmailTest implements Serializable{

	/** 
	* @Fields serialVersionUID : TODO(用一句话描述这个变量表示什么) 
	*/ 
	private static final long serialVersionUID = -7628953405212662816L;

	private String email; //邮箱地址
	
	private boolean checkEmail;
	
	/*
	 * 默认无参构造函数
	 */
	public EmailTest(){
		
	}
	/*
	 * 构造函数
	 * 
	 */
	public EmailTest(String email){
		this.email = email;
	}

	/**
	 * 
	* @Title: isEmail 
	* @Description: TODO(这里用一句话描述这个方法的作用) 验证邮箱
	* @param @return    设定文件 
	* @return boolean    返回类型 
	* @throws
	 */
	public boolean isEmail(){
		String reg = "\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*";	//邮箱正则表达式
		if(email.matches(reg)){
			checkEmail = true;
		}
		
		return checkEmail;
	}
	
	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}
	
	
}
